home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
web
/
noweb
/
src
/
Makefile.nw
< prev
next >
Wrap
Makefile
|
1995-02-24
|
4KB
|
124 lines
I got sick and tired of copying goo for multiple files.
This nonsense is the result. (Too bad mk isn't everywhere.)
<<version>>=
2.7
<<script>>=
(cat Makefile.nw; echo ""; notangle -t8 -R'generate chunks' Makefile.nw | sh) | notangle -t8 -
<<*>>=
# Copyright 1995 by Norman Ramsey. All rights reserved.
# See file COPYRIGHT for more information.
#
# Adjust these two lines for your ANSI C compiler
CC=gcc
CFLAGS=
# If you have Icon, you should use the Icon versions of the noweb pipeline.
# Set LIBSRC=icon
LIBSRC=awk
# If you have no Icon compiler, but do have icont, make ICONC=icont
ICONC=iconc
ICONT=icont
# BIN is where the commands (notangle, noweave, nountangle, noroots) land
# LIB is where the pieces of the pipes (nt, markup, unmarkup) are stored
# MAN is the root of your local man pages directory
# MANEXT is the extension for your commands' man pages (usually 1 or l)
# TEXINPUTS is the directory for TeX macro files
BIN=/usr/public/pkg/noweb/bin
LIB=/usr/public/pkg/noweb/lib
MAN=/usr/public/pkg/noweb/man
MANEXT=1
TEXINPUTS=/usr/public/pkg/tex/tex/inputs
# change WEAVE if you want a different version of noweave to be installed
WEAVE=noweave
# Stop editing. No user-serviceable parts below.
SHELL=/bin/sh
NAME=version
CIMSG=checked in with name $(NAME)
MANDIR=$(MAN)/man$(MANEXT)
CATDIR=$(MAN)/cat$(MANEXT)
LIBNAME=$(LIB)
TEXNAME=$(TEXINPUTS)
all:
cd c; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
cd lib; make all
cd xdoc; make all
cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
install: install-code install-man install-tex
install-code:
-mkdir $(BIN) $(LIB) 2>/dev/null
strip c/nt c/markup c/mnt c/finduses
cp c/nt c/markup c/mnt c/finduses $(LIB)
cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
cp lib/unmarkup lib/emptydefn $(LIB)
<<shell binaries>>
<<generate chunks>>=
echo '@<<shell binaries@>>='
for i in noweb notangle '$(WEAVE)' nountangle nodefs noroots nuweb2noweb cpif
do
echo 'sed "s@|LIBDIR|@$(LIBNAME)@"' "shell/$i" '> $(BIN)/'"$i"
echo 'chmod +x $(BIN)/'"$i"
done
<<*>>=
install-man:
-mkdir $(MAN) $(MANDIR) 2>/dev/null
<<ordinary pages>>
<<*>>=
install-preformat-man:
-mkdir $(MAN) $(CATDIR) 2>/dev/null
<<preformatted compressed pages>>
<<generate chunks>>=
NORMALPAGES="cpif nodefs noroots noweb noindex nowebstyle nuweb2noweb nowebfilters notangle sl2h"
LINKPAGES="noweave nountangle"
echo '@<<ordinary pages@>>='
for i in $NORMALPAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.1" '> $(MANDIR)/'"$i"'.$(MANEXT)'
done
for i in $LINKPAGES; do
echo 'rm -f $(MANDIR)/'"$i"'.$(MANEXT)'
echo '(cd $(MANDIR); ln notangle.$(MANEXT)' "$i"'.$(MANEXT))'
done
echo '@<<preformatted compressed pages@>>='
for i in $NORMALPAGES; do
echo 'sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@"' \
"xdoc/$i.txt" ' | gzip > $(CATDIR)/'"$i"'.$(MANEXT).gz'
done
for i in $LINKPAGES; do
echo 'rm -f $(CATDIR)/'"$i"'.$(MANEXT).gz'
echo '(cd $(CATDIR); ln notangle.$(MANEXT).gz' "$i"'.$(MANEXT).gz)'
done
<<*>>=
install-tex:
-mkdir $(TEXINPUTS) 2>/dev/null
cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS)
checkin:
for i in lib tex; do (cd $$i; ci -l -n'$(NAME)' -m'$(CIMSG)' *); done
cd xdoc; ci -l -n'$(NAME)' -m'$(CIMSG)' *.nw *.tex
for i in c icon awk; do (cd $$i; ci -l -n'$(NAME)' -m'$(CIMSG)' *.nw Makefile); done
ci -l -n'$(NAME)' -m'$(CIMSG)' Makefile INSTALL README COPYRIGHT nwmake *.nw
source: ; for i in c shell lib xdoc icon awk tex; do (cd $$i; make source); done
clean:
for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
rm -f nwsrcfilter *~ */*~
veryclean: clean
for i in c lib icon awk; do (cd $$i; make veryclean); done
Makefile: Makefile.nw
chmod +w Makefile
notangle -R'script' Makefile.nw | sh > Makefile
chmod -w Makefile